/*
 * Copyright (c) 2021 iSoftStone Device Co., Ltd.
 *
 * HDF is dual licensed: you can use it either under the terms of
 * the GPL, or the BSD license, at your option.
 * See the LICENSE file in the root of this repository for complete details.
 */

#ifndef SUNXI_DMA_OPS_H
#define SUNXI_DMA_OPS_H

#include <linux/dmaengine.h>
#include "audio_core.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */

#if IS_ENABLED(CONFIG_DRIVERS_HDF_AUDIO_T527)
#include "t527_aiao_impl.h"
#elif IS_ENABLED(CONFIG_DRIVERS_HDF_AUDIO_T507)
#include "t507_aiao_impl.h"
#endif

int32_t SunxiAudioDmaDeviceInit(const struct AudioCard *card, const struct PlatformDevice *platform);
int32_t SunxiAudioDmaBufAlloc(struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaBufFree(struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaRequestChannel(const struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaConfigChannel(const struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaPrep(const struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaSubmit(const struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaPending(struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaPause(struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaResume(const struct PlatformData *data, const enum AudioStreamType streamType);
int32_t SunxiAudioDmaPointer(struct PlatformData *data, const enum AudioStreamType streamType, uint32_t *pointer);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */

#endif /* SUNXI_DMA_OPS_H */
